<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("basePath", basePath);
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>作品管理</title>
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet"
	href="${basePath }/admin/bower_components/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
	<table class="table table-hover">
		<thead>
			<tr>
				<td colspan="6"><a class="btn btn-primary btn-lg active"
					href="${basePath }admin/toEditWork.action">添加数据</a></td>
			</tr>

			<tr>
				<th>编号</th>
				<th>名称</th>
				<th>图片</th>
				<th>标题</th>
				<th>链接</th>
				<th>时间</th>
				<th>类型</th>
				<th>&nbsp;&nbsp;操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${workList }" var="work">
				<tr>
					<th scope="row">${work.id }</th>
					<td>${work.name }</td>
					<td>${work.image }</td>
					<td>${work.title }</td>
					<td>${work.url }</td>
					<td>${work.time }</td>
					<td>${work.type }</td>
					<td><a
						href="${basePath }admin/toEditWork.action?id=${work.id}"><span
							class="glyphicon glyphicon-pencil"></span></a>&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="${basePath }admin/deleteWork.action?id=${work.id}"
						onclick="return confirm('是否确认删除数据？')"><span
							class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	
</body>
</html>